package cn.jinjie.day03.test18;

import java.util.Random;

public class Beer extends Drink implements Lotto {
    public Beer() {
    }

    public Beer(String name, double price) {
        super(name, price);
    }

    @Override
    public void taste() {
        System.out.println("我是有故事的啤酒，味道是涩的");
    }

    @Override
    public double lotto() {
        // 输出 name（品名）+"啤酒正在参与揭盖有奖活动",并返回随机优惠金额:（算法 0-1的随机数 * price价格)
        System.out.println(getName() + "啤酒正在参与揭盖有奖活动");
        Random r = new Random();
        double v = r.nextDouble(1);
        // System.out.println(v);
        return v * getPrice();
    }
}
